<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE hibernate-mapping PUBLIC
    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
    <class name="cn.firstsoft.modules.loge.domain.LogeRoom" table="loge_room">
        <id name="id" type="integer">
            <column name="id" />
            <generator class="native" >
				<param name="sequence">LOGE_ROOM_ID_SEQ</param>
            </generator>
        </id>
        <property name="no" type="string">
            <column name="no" length="50"/>
        </property>
        <property name="floor" type="string">
            <column name="floor" length="50"/>
        </property>
        <property name="rem" type="string">
            <column name="rems" length="250"/>
        </property>
        <property name="bedCount" type="integer">
            <column name="bed_count"/>
       </property>
        <property name="type" type="string">
           <column name="type" length="50"/>
       </property>
        <property name="name" type="java.lang.String">
             <column name="name" length="50"/>
       </property>
        <property name="status" type="string">
                 <column name="status" length="50"/>
       </property>
       <property name="useing" type="string">
                 <column name="useing" length="50"/>
       </property>
        <property name="createDate" type="timestamp">
           <column name="create_date" length="50"/>
       </property>
        <set name="logeBed" inverse="true" order-by="no" cascade="all">
            <key>
                <column name="room_id" />
            </key>
            <one-to-many class="cn.firstsoft.modules.loge.domain.LogeBed" />
        </set>
        <many-to-one name="loge" class="cn.firstsoft.modules.loge.domain.Loge" fetch="select">
        <column name="loge_id"></column>
        </many-to-one>
        <many-to-one name="logeGrade" class="cn.firstsoft.modules.loge.domain.LogeGrade" fetch="select">
        <column name="grade_id"/>
        </many-to-one>
    </class>
</hibernate-mapping>
